#ifndef __VERTEX_BUFFER_H__
#define __VERTEX_BUFFER_H__

#include "GL/glew.h"

namespace Hope {

    class VertexBuffer
    {
    public:
        VertexBuffer(int vertexSize, int vertexNums, GLenum usage = GL_STATIC_DRAW);

        virtual ~VertexBuffer();

        int GetVertexSize() const;
        int GetVertexNums() const;

        int GetSize() const;

        bool UpdateVertices(const void *verts, int count, int begin);

        GLuint GetVBO() const;

    protected:
        mutable GLuint m_vbo;

        int m_vertexSize;

        int m_vertexNums;

        GLenum m_usage;
    };


    class IndexBuffer
    {
    public:
        IndexBuffer(int nums, GLenum usage = GL_STATIC_DRAW);

        virtual ~IndexBuffer();

        int GetIndexSize() const;
        
        int GetIndexNums() const;

        bool UpdateIndices(const void *indices, int count, int begin);

        int GetSize() const;

        GLuint GetVBO() const;

    protected:
        mutable GLuint m_vbo;

        int m_indexNums;

        GLenum m_usage;
    };

}

#endif
